package cn.kone.blog.service.impl;


import cn.kone.blog.domain.Comment;
import cn.kone.blog.repository.CommentRepository;
import cn.kone.blog.service.ICommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements ICommentService {

    @Autowired
    private CommentRepository repository;

    @Override
    public List<Comment> findByArticleId(Long articleId) {
        return repository.findByArticleId(articleId);
    }

    @Override
    public void delete(Long id) {
    }

    @Override
    public void add(Comment comment) {
        repository.save(comment);
    }

    @Override
    public void update(Comment comment) {
        repository.save(comment);
    }
}
